package com.baiyue.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.Version;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

/**
 *
 * @author 伍波
 * @date 2024-07-11
 */
@Data
@TableName("payment_records")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Validated
public class PaymentRecords implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增长ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 应付金额，精确到小数点后两位
     */
    @TableField("amount_due")
    private BigDecimal amountDue;
    /**
     * 实收金额，精确到小数点后两位
     */
    @TableField("amount_received")
    private BigDecimal amountReceived;
    /**
     * 抹零金额，精确到小数点后两位
     */
    @TableField("rounding_amount")
    private BigDecimal roundingAmount;
    /**
     * 找零金额，精确到小数点后两位
     */
    @TableField("change_amount")
    private BigDecimal changeAmount;
    /**
     * 折扣率，精确到小数点后两位
     */
    private BigDecimal discount;
    /**
     * 支付方式，最大长度为50个字符 
     */
    @TableField("payment_method")
    private String paymentMethod;
    /**
     * 包间费用，精确到小数点后两位
     */
    @TableField("room_fee")
    private BigDecimal roomFee;
    /**
     * 商品金额，精确到小数点后两位
     */
    @TableField("goods_amount")
    private BigDecimal goodsAmount;
    /**
     * 记录创建时间，默认为当前时间戳
     */
    @TableField("created_at")
    private Date createdAt;

    /**
     * 包间uuid
     */
    private String uuid;
    /**
     * 超时费用
     */
    @TableField("overtime_fee")
    private BigDecimal overtimeFee;
    /**
     * 夜间服务费用
     */
    @TableField("night_fee")
    private BigDecimal nightFee;
    /**
     * 开始时间
     */
    @TableField(exist = false)
    private String start;

    /**
     * 结束时间
     */
    @TableField(exist = false)
    private String end;

    /**
     * 排序字段
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortField;

    /**
     * 排序顺序
     * desc  asc
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortValue;

    public PaymentRecords(BigDecimal amountDue, BigDecimal amountReceived, BigDecimal roundingAmount,
                          BigDecimal changeAmount, BigDecimal discount, String paymentMethod, BigDecimal roomFee,
                          BigDecimal goodsAmount, Date createdAt, String uuid, BigDecimal overtimeFee,
                          BigDecimal nightFee, String start, String end, String sortField, String sortValue) {
        this.amountDue = amountDue;
        this.amountReceived = amountReceived;
        this.roundingAmount = roundingAmount;
        this.changeAmount = changeAmount;
        this.discount = discount;
        this.paymentMethod = paymentMethod;
        this.roomFee = roomFee;
        this.goodsAmount = goodsAmount;
        this.createdAt = createdAt;
        this.uuid = uuid;
        this.overtimeFee = overtimeFee;
        this.nightFee = nightFee;
        this.start = start;
        this.end = end;
        this.sortField = sortField;
        this.sortValue = sortValue;
    }
}
